<?php
if(!session_id()){
	session_start();
}
if(empty($_POST['page'])){
	exit();
}
if(!empty($_SESSION['pagemax'])){
	if($_POST['page']>$_SESSION['pagemax']){
		exit();
	}
}
$page = $_POST['page']+0;
$start = ($page*10);
$end = 20;
include('mysql.class.php'); 
$mysql = new mysql();
$arr = $mysql->getAll("select * from info limit $start,$end");
if(empty($arr)){
	if(!session_id()){
		session_start();
	}
	$_SESSION['pagemax'] = $page;
}
sleep(1);
echo json_encode($arr);
?>